package com.xbongbong.paas.service.dingtalkTodo;

import com.xbongbong.pro.enums.workrecord.enums.WorkrecordResultEnum;
import com.xbongbong.pro.process.pojo.dto.WorkrecordInstanceDTO;
import com.xbongbong.pro.process.pojo.dto.WorkrecordTaskDTO;
import com.xbongbong.pro.process.pojo.dto.WorkrecordUpdateTaskDTO;

/**
 * @author chenpeng
 * @version 1.0
 * @date 2021-05-18 10:19
 * @description
 */
public interface WorkflowDingtalkTodoService {
    
    /**
     * 获取待办配置
     * @param corpid
     */
    String getCompanyDingtalkTodoProcessCode(String corpid);
    
    /**
     * 创建钉钉待办实例
     * @param workrecordInstanceDTO
     */
    void createDingtalkTodoInstance(WorkrecordInstanceDTO workrecordInstanceDTO);
    
    /**
     * 更新实例状态(通过/拒绝)
     * @param corpid
     * @param processInstanceId
     * @param workrecordResultEnum
     */
    boolean updateDingtalkTodoInstance(String corpid, String processInstanceId, WorkrecordResultEnum workrecordResultEnum);
    
    /**
     * 删除钉钉待办实例
     * @param corpid
     * @param processInstanceId
     */
    boolean deleteDingtalkTodoInstance(String corpid, String processInstanceId);
    
    /**
     * 创建钉钉待办任务
     * @param workrecordTaskDTO
     */
    void createDingtalkTodoTask(WorkrecordTaskDTO workrecordTaskDTO);
    
    /**
     * 更新单个任务状态(同意/拒绝)
     * @param workrecordUpdateTaskDTO
     * @param workrecordResultEnum
     */
    boolean updateSingleDingtalkTodoTask(WorkrecordUpdateTaskDTO workrecordUpdateTaskDTO, WorkrecordResultEnum workrecordResultEnum);
    
    /**
     * 批量取消任务
     * @param workrecordUpdateTaskDTO
     */
    boolean cancelDingtalkTodoTaskGroup(WorkrecordUpdateTaskDTO workrecordUpdateTaskDTO);
    
    /**
     * 删除钉钉模板
     * @param corpid
     * @param processCode
     */
    boolean delDingtalkTodoProcessTemplate(String corpid, String processCode);
}
